var array=['a','b','c']
for (let item of array) {
    console.log(item)
}
for (const index in array) {
    console.log(index)
}

function classConstructorLog(constructor:Function){
    console.log("装饰器被调用",constructor)
    return // @ts-ignore
        class extends constructor{
        other='other'
    }
}
// @ts-ignore
@classConstructorLog
class MyObject{
    data:string
    constructor() {
        this.data="data"
        console.log("My Object的构造函数")
    }
}

var obj=new MyObject();
console.log(obj)

function helloWorld(target:any,propertKey:string,desc:PropertyDecorator){
    console.log("helloWorld");
    console.log(target,propertKey,desc)
}

class Peple{
    // @ts-ignore
    @helloWorld
    sayHi(){
        console.log("Hi")
    }
}

var p=new Peple();
p.sayHi()

function logFunction(target:any,propertyKey:string,descriptor:PropertyDescriptor){
    console.log("logFunction")
    console.log(target,propertyKey,descriptor)
    // descriptor.writable=false
}

// class Rect{
//     private _width:number=0
//     // @ts-ignore
//     @logFunction()
//     set width(w:number){
//         this._width=w
//     }
// }

namespace MathTool{
    export function add(num1:number,num2:number){
        return num1+num2;
    }
    export function  sub(num1:number,num2:number){
        return num1-num2;
    }
    var PI=3.14;
    export function clrcleArea(radius:number){
        return PI*radius*radius;
    }
}
import CicleArea=MathTool.clrcleArea;
console.log(MathTool.add(1,2))
console.log(MathTool.sub(1,2))
console.log(CicleArea(10))


import {Log}  from "./myModule";
import * as Modlue  from "./myModule";
import {Log as MyLog}  from "./myModule";
MyLog()
